// 2025/3/23
// https://leetcode.cn/problems/kth-largest-element-in-an-array/?envType=study-plan-v2&envId=top-100-liked
// 数组中的第k个最大元素

class Solution {
    public:
        int findKthLargest(vector<int>& nums, int k) {
            priority_queue<int> heap(nums.begin(), nums.end());
            while(--k)
            {
                heap.pop();
            }
            return heap.top();
        }
    };